﻿using System;
using System.Text;
using IAM.Interface.Model.Interface;
using System.Web;

namespace IAM.Interface.Model
{
    /// <summary>
    /// 组织结构删除 组织机构信息
    /// </summary>
    public class OrganizeDeleteParameter : AbstractConvertObject, IConvertXml
    {
        #region 属性
        private string _orgid = "";
        private string _mergeorgid = "";

        /// <summary>
        /// 需要删除组织机构标识
        /// </summary>
        public string OrgID
        {
            get
            {
                return _orgid;
            }
            set
            {
                _orgid = value;
            }

        }
        /// <summary>
        /// 合并后的组织机构标识。
        /// 如果只删除不合并，该字段为空。
        /// </summary>
        public string MergeOrgID
        {
            get
            {
                return _mergeorgid;
            }
            set
            {
                _mergeorgid = value;
            }

        }
        #endregion
        #region IConvertXml

        public string XMLBoday
        {
            get
            {
                StringBuilder xml = new StringBuilder();

                xml.Append(" <OrgID>" + IAM.Interface.Common.EnDeCoding.Encode(this.OrgID) + "</OrgID>");
                xml.Append(" <MergeOrgID>" + IAM.Interface.Common.EnDeCoding.Encode(this.MergeOrgID )+ "</MergeOrgID>");
                return xml.ToString();
            }


        }

        public string XMLFinis
        {
            get
            {
                return "";
            }
        }
        public string XML
        {
            get
            {
                return XMLBoday + XMLFinis;
            }
        }
        #endregion
        #region AbstractConvertObject
        public override object ConvertToObject()
        {
            this.OrgID = IAM.Interface.Common.EnDeCoding.Decode(this.CurrentXmlNode.SelectSingleNode("OrgID").InnerText);
            this.MergeOrgID = IAM.Interface.Common.EnDeCoding.Decode(this.CurrentXmlNode.SelectSingleNode("MergeOrgID").InnerText);
            return this;
        }
        #endregion
    }
}
